package gps.rules;

import gps.api.GPSRule;
import gps.implementationAPI.GPSRuleImplementation;

import java.util.LinkedList;
import java.util.List;

public class Rules {
	private List<GPSRule> rules;
	
	public Rules() {
		this.rules = new LinkedList<GPSRule>();
	}
	
	public void addRule (GPSRule rule) {
		this.rules.add(rule);
	}
	
	public void createRules () {
		this.rules.add(createSingleRule(Move.MOVE_DOWN));
		this.rules.add(createSingleRule(Move.MOVE_UP));
		this.rules.add(createSingleRule(Move.MOVE_LEFT));
		this.rules.add(createSingleRule(Move.MOVE_RIGHT));
	}
	
	public List<GPSRule> getRules () {
		return this.rules;
	}
	
	private GPSRule createSingleRule (Move m) {
		GPSRule rule = new GPSRuleImplementation(m);
		return rule;
	}
}
